﻿<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	template="/layout/template_box.xhtml"
	xmlns:a4j="http://richfaces.org/a4j">


	<ui:define name="head">
		<a4j:loadStyle src="/css/custom-theme/jquery-ui-1.8.2.custom.css" />
		<!-- <a4j:loadScript src="/js/alertaInstituicao.js" />-->


	</ui:define>

	<ui:define name="MenuInterno">
		<ui:include src="/layout/menu_aluno.xhtml" />
	</ui:define>


	<ui:define name="body">

		<h2 class="t_aluno">Alunos</h2>

		<div id="tamanho_div">


			<h:form styleClass="form_confea" ajaxSubmit="true" id="form">
			  	<fieldset>
						<h:messages globalOnly="true" styleClass="tool_alerta" />
				</fieldset>
				<fieldset>
					<legend>Opções de Busca</legend>
					<ol>

						<li><s:div id="divNome">
﻿                  <s:decorate id="nomeField"
									template="/layout/edit.xhtml">
﻿                    <ui:define name="label">Nome</ui:define>
﻿                    <h:inputText id="nome" styleClass="campo_full"
										required="true" requiredMessage="O campo é obrigatório"
										value="#{alunoList.alunoPesquisa.nome}" />
﻿                      
﻿                  </s:decorate>
							</s:div></li>

					</ol>
					<s:div id="divBotoes">
﻿  ﻿          <h:commandLink styleClass="btn" valeu="Pesquisar"
							action="#{alunoList.pesquisar}">Pesquisar</h:commandLink>
﻿  ﻿          <h:commandLink styleClass="btn" valeu="Limpar" immediate="true" onclick="jQuery('[id$=nome]').val('')"
							action="#{alunoList.listar}">Limpar</h:commandLink>
﻿          </s:div>
				</fieldset>




				<fieldset>
					<s:div rendered="#{listaAlunos.size == 0}">
						<p class="tool_alerta">Nenhum Aluno encontrado.</p>
					</s:div>

					<s:div id="tabelaAluno">
					<rich:dataTable value="#{listaAlunos}" var="_aluno"
						styleClass="grid_dados" cellpadding="0" cellspacing="0" border="0"
						id="alunoLista" rows="#{alunoList.paginacao}"
						rowClasses="grid_zebra,none">

						<rich:column>
							<f:facet name="header">Nome</f:facet>
							<h:outputText value="#{_aluno.nome}" />
						</rich:column>
						
						<rich:column>
							<f:facet name="header">Telefones</f:facet>
							<h:outputText value="#{_aluno.telefone} / #{_aluno.celular}" />
						</rich:column>
						
										
						<rich:column style="width:27%">
							<f:facet name="header">Ações</f:facet>
							
							 <s:link title="Editar Aluno" id="btnEditar" rendered="#{s:hasRole('Gestor') or s:hasRole('Secretária')}" 
									styleClass="editar2" view="/aluno/aluno.xhtml"
									propagation="none">
﻿                    							 <f:param name="idAluno" value="#{_aluno.id}" />
								</s:link> <s:link title="Incluir Evasão" id="btnEvasao"
									rendered="#{s:hasRole('Gestor') or s:hasRole('Secretária')}" 
									styleClass="evasao" view="/aluno/evasao.xhtml"
									propagation="none">
﻿                     							<f:param name="idAluno" value="#{_aluno.id}" />
								</s:link> ﻿ ﻿ ﻿ ﻿ ﻿ 
								<s:link title="Incluir Destino" id="btnDestino"
									rendered="#{s:hasRole('Gestor') or s:hasRole('Secretária')}" 
									styleClass="destino" view="/aluno/destino.xhtml"
									propagation="none">
﻿                     								<f:param name="idAluno" value="#{_aluno.id}" />
								</s:link> ﻿
								<s:link title="Avaliação de Psicogenese"
									rendered="#{s:hasRole('Gestor') or s:hasRole('Secretária') or s:hasRole('Professor')}" 
									id="btnAvaliacao" styleClass="avaliacao"
									view="/aluno/avaliacaoPsicogenese.xhtml" propagation="none">
﻿                     								<f:param name="idAluno" value="#{_aluno.id}" />
								</s:link>
							
								
								 <a4j:commandLink rendered="#{s:hasRole('Gestor') or s:hasRole('Secretária')}"  
								 	action="#{alunoList.apagar}" ajaxSingle="true"
	                    	 		styleClass="excluir2" id="btnExcluir2" reRender="form" limitToList="true" immediate="true"
			                        title="Excluir"
			                        onclick="if(!confirm('Confirma a exclusão?'))return false;"
			                        >
			                        <f:setPropertyActionListener target="#{alunoList.aluno}" value="#{_aluno}" />
			                    </a4j:commandLink>
								
								
						</rich:column>

					</rich:dataTable>
					<rich:datascroller id="scrolInstituicao" for="alunoLista"
						maxPages="#{alunoList.paginacao}" align="center"
						renderIfSinglePage="false" />
					</s:div>
				</fieldset>
			</h:form>

		</div>
	</ui:define>

</ui:composition>
